GrapeCity.CalcEngine.Functions Namespace > CalcIfFunction Class > Evaluate Method : Evaluate(Object[]) Method |
The args contains three items: logical_test, value_if_true and value_if_false.
logical_test is any value or expression that can be evaluated to true or false. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to true. Otherwise, the expression evaluates to false. This argument can use any comparison calculation operator.
value_if_true is the value that is returned if logical_test is true. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to true, then the IF function displays the text "Within budget". If logical_test is true and value_if_true is blank, this argument returns 0 (zero). To display the word true, use the logical value true for this argument. Value_if_true can be another formula.
value_if_false is the value that is returned if logical_test is false. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to false, then the IF function displays the text "Over budget". If logical_test is false and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value false is returned. If logical_test is false and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula.
'Usage Dim instance As CalcIfFunction Dim args() As Object Dim value As Object value = instance.Evaluate(args)
The args contains three items: logical_test, value_if_true and value_if_false.
logical_test is any value or expression that can be evaluated to true or false. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to true. Otherwise, the expression evaluates to false. This argument can use any comparison calculation operator.
value_if_true is the value that is returned if logical_test is true. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to true, then the IF function displays the text "Within budget". If logical_test is true and value_if_true is blank, this argument returns 0 (zero). To display the word true, use the logical value true for this argument. Value_if_true can be another formula.
value_if_false is the value that is returned if logical_test is false. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to false, then the IF function displays the text "Over budget". If logical_test is false and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value false is returned. If logical_test is false and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula.
Target Platforms: Windows Server 2012, Windows RT